home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / cdplay2a / cdinte~1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-23  |  34.8 KB  |  958 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form CDIface 
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "CD Deluxe"
  6.    ClientHeight    =   6105
  7.    ClientLeft      =   0
  8.    ClientTop       =   0
  9.    ClientWidth     =   6075
  10.    BeginProperty Font 
  11.       Name            =   "Arial"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   400
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    Icon            =   "CD Interface Form.frx":0000
  20.    LinkTopic       =   "Form2"
  21.    LockControls    =   -1  'True
  22.    ScaleHeight     =   6105
  23.    ScaleWidth      =   6075
  24.    StartUpPosition =   3  'Windows Default
  25.    Begin MSComDlg.CommonDialog cdgIface 
  26.       Left            =   4845
  27.       Top             =   1050
  28.       _ExtentX        =   847
  29.       _ExtentY        =   847
  30.       _Version        =   393216
  31.       DialogTitle     =   "Load Skin"
  32.       Filter          =   "*.bmp"
  33.    End
  34.    Begin VB.PictureBox picControlMin 
  35.       AutoRedraw      =   -1  'True
  36.       BorderStyle     =   0  'None
  37.       BeginProperty Font 
  38.          Name            =   "MS Sans Serif"
  39.          Size            =   8.25
  40.          Charset         =   0
  41.          Weight          =   400
  42.          Underline       =   0   'False
  43.          Italic          =   0   'False
  44.          Strikethrough   =   0   'False
  45.       EndProperty
  46.       Height          =   195
  47.       Left            =   3960
  48.       ScaleHeight     =   195
  49.       ScaleWidth      =   195
  50.       TabIndex        =   3
  51.       Top             =   60
  52.       Width           =   195
  53.    End
  54.    Begin VB.PictureBox picControlExit 
  55.       AutoRedraw      =   -1  'True
  56.       BorderStyle     =   0  'None
  57.       BeginProperty Font 
  58.          Name            =   "MS Sans Serif"
  59.          Size            =   8.25
  60.          Charset         =   0
  61.          Weight          =   400
  62.          Underline       =   0   'False
  63.          Italic          =   0   'False
  64.          Strikethrough   =   0   'False
  65.       EndProperty
  66.       Height          =   195
  67.       Left            =   4200
  68.       ScaleHeight     =   195
  69.       ScaleWidth      =   195
  70.       TabIndex        =   2
  71.       Top             =   60
  72.       Width           =   195
  73.    End
  74.    Begin VB.PictureBox picTitleBar 
  75.       AutoRedraw      =   -1  'True
  76.       BackColor       =   &H00808080&
  77.       BorderStyle     =   0  'None
  78.       BeginProperty Font 
  79.          Name            =   "MS Sans Serif"
  80.          Size            =   8.25
  81.          Charset         =   0
  82.          Weight          =   400
  83.          Underline       =   0   'False
  84.          Italic          =   0   'False
  85.          Strikethrough   =   0   'False
  86.       EndProperty
  87.       Height          =   300
  88.       Left            =   0
  89.       ScaleHeight     =   300
  90.       ScaleWidth      =   4515
  91.       TabIndex        =   1
  92.       Top             =   0
  93.       Width           =   4515
  94.    End
  95.    Begin VB.PictureBox PicSourceImage 
  96.       AutoRedraw      =   -1  'True
  97.       AutoSize        =   -1  'True
  98.       BorderStyle     =   0  'None
  99.       BeginProperty Font 
  100.          Name            =   "MS Sans Serif"
  101.          Size            =   8.25
  102.          Charset         =   0
  103.          Weight          =   400
  104.          Underline       =   0   'False
  105.          Italic          =   0   'False
  106.          Strikethrough   =   0   'False
  107.       EndProperty
  108.       Height          =   3360
  109.       Left            =   -360
  110.       Picture         =   "CD Interface Form.frx":1CFA
  111.       ScaleHeight     =   3360
  112.       ScaleWidth      =   5940
  113.       TabIndex        =   0
  114.       Top             =   2280
  115.       Width           =   5940
  116.    End
  117.    Begin VB.Timer Timer1 
  118.       Enabled         =   0   'False
  119.       Interval        =   1000
  120.       Left            =   4875
  121.       Top             =   510
  122.    End
  123.    Begin VB.PictureBox picMain 
  124.       AutoRedraw      =   -1  'True
  125.       BackColor       =   &H00404040&
  126.       BorderStyle     =   0  'None
  127.       BeginProperty Font 
  128.          Name            =   "MS Sans Serif"
  129.          Size            =   8.25
  130.          Charset         =   0
  131.          Weight          =   400
  132.          Underline       =   0   'False
  133.          Italic          =   0   'False
  134.          Strikethrough   =   0   'False
  135.       EndProperty
  136.       Height          =   1875
  137.       Left            =   -15
  138.       ScaleHeight     =   1875
  139.       ScaleWidth      =   4530
  140.       TabIndex        =   4
  141.       Top             =   300
  142.       Width           =   4530
  143.       Begin VB.PictureBox picLoadSkin 
  144.          AutoRedraw      =   -1  'True
  145.          BorderStyle     =   0  'None
  146.          BeginProperty Font 
  147.             Name            =   "MS Sans Serif"
  148.             Size            =   8.25
  149.             Charset         =   0
  150.             Weight          =   400
  151.             Underline       =   0   'False
  152.             Italic          =   0   'False
  153.             Strikethrough   =   0   'False
  154.          EndProperty
  155.          Height          =   330
  156.          Left            =   3645
  157.          ScaleHeight     =   330
  158.          ScaleWidth      =   330
  159.          TabIndex        =   15
  160.          Top             =   495
  161.          Width           =   330
  162.       End
  163.       Begin VB.ComboBox cboTrack 
  164.          BackColor       =   &H00404040&
  165.          BeginProperty Font 
  166.             Name            =   "MS Sans Serif"
  167.             Size            =   8.25
  168.             Charset         =   0
  169.             Weight          =   700
  170.             Underline       =   0   'False
  171.             Italic          =   0   'False
  172.             Strikethrough   =   0   'False
  173.          EndProperty
  174.          ForeColor       =   &H00FF8080&
  175.          Height          =   315
  176.          Left            =   3810
  177.          TabIndex        =   14
  178.          Top             =   885
  179.          Width           =   540
  180.       End
  181.       Begin VB.PictureBox Picture9 
  182.          AutoRedraw      =   -1  'True
  183.          BorderStyle     =   0  'None
  184.          BeginProperty Font 
  185.             Name            =   "MS Sans Serif"
  186.             Size            =   8.25
  187.             Charset         =   0
  188.             Weight          =   400
  189.             Underline       =   0   'False
  190.             Italic          =   0   'False
  191.             Strikethrough   =   0   'False
  192.          EndProperty
  193.          Height          =   330
  194.          Left            =   3270
  195.          ScaleHeight     =   330
  196.          ScaleWidth      =   330
  197.          TabIndex        =   13
  198.          Top             =   495
  199.          Width           =   330
  200.       End
  201.       Begin VB.PictureBox Picture8 
  202.          AutoRedraw      =   -1  'True
  203.          BorderStyle     =   0  'None
  204.          BeginProperty Font 
  205.             Name            =   "MS Sans Serif"
  206.             Size            =   8.25
  207.             Charset         =   0
  208.             Weight          =   400
  209.             Underline       =   0   'False
  210.             Italic          =   0   'False
  211.             Strikethrough   =   0   'False
  212.          EndProperty
  213.          Height          =   330
  214.          Left            =   4020
  215.          ScaleHeight     =   330
  216.          ScaleWidth      =   330
  217.          TabIndex        =   12
  218.          Top             =   495
  219.          Width           =   330
  220.       End
  221.       Begin VB.PictureBox Picture7 
  222.          AutoRedraw      =   -1  'True
  223.          BorderStyle     =   0  'None
  224.          BeginProperty Font 
  225.             Name            =   "MS Sans Serif"
  226.             Size            =   8.25
  227.             Charset         =   0
  228.             Weight          =   400
  229.             Underline       =   0   'False
  230.             Italic          =   0   'False
  231.             Strikethrough   =   0   'False
  232.          EndProperty
  233.          Height          =   330
  234.          Left            =   2895
  235.          ScaleHeight     =   330
  236.          ScaleWidth      =   330
  237.          TabIndex        =   11
  238.          Top             =   495
  239.          Width           =   330
  240.       End
  241.       Begin VB.PictureBox Picture6 
  242.          AutoRedraw      =   -1  'True
  243.          BorderStyle     =   0  'None
  244.          BeginProperty Font 
  245.             Name            =   "MS Sans Serif"
  246.             Size            =   8.25
  247.             Charset         =   0
  248.             Weight          =   400
  249.             Underline       =   0   'False
  250.             Italic          =   0   'False
  251.             Strikethrough   =   0   'False
  252.          EndProperty
  253.          Height          =   330
  254.          Left            =   2520
  255.          ScaleHeight     =   330
  256.          ScaleWidth      =   330
  257.          TabIndex        =   10
  258.          Top             =   495
  259.          Width           =   330
  260.       End
  261.       Begin VB.PictureBox Picture5 
  262.          AutoRedraw      =   -1  'True
  263.          BorderStyle     =   0  'None
  264.          BeginProperty Font 
  265.             Name            =   "MS Sans Serif"
  266.             Size            =   8.25
  267.             Charset         =   0
  268.             Weight          =   400
  269.             Underline       =   0   'False
  270.             Italic          =   0   'False
  271.             Strikethrough   =   0   'False
  272.          EndProperty
  273.          Height          =   330
  274.          Left            =   4020
  275.          ScaleHeight     =   330
  276.          ScaleWidth      =   330
  277.          TabIndex        =   9
  278.          Top             =   105
  279.          Width           =   330
  280.       End
  281.       Begin VB.PictureBox Picture4 
  282.          AutoRedraw      =   -1  'True
  283.          BorderStyle     =   0  'None
  284.          BeginProperty Font 
  285.             Name            =   "MS Sans Serif"
  286.             Size            =   8.25
  287.             Charset         =   0
  288.             Weight          =   400
  289.             Underline       =   0   'False
  290.             Italic          =   0   'False
  291.             Strikethrough   =   0   'False
  292.          EndProperty
  293.          Height          =   330
  294.          Left            =   3645
  295.          ScaleHeight     =   330
  296.          ScaleWidth      =   330
  297.          TabIndex        =   8
  298.          Top             =   105
  299.          Width           =   330
  300.       End
  301.       Begin VB.PictureBox Picture3 
  302.          AutoRedraw      =   -1  'True
  303.          BorderStyle     =   0  'None
  304.          BeginProperty Font 
  305.             Name            =   "MS Sans Serif"
  306.             Size            =   8.25
  307.             Charset         =   0
  308.             Weight          =   400
  309.             Underline       =   0   'False
  310.             Italic          =   0   'False
  311.             Strikethrough   =   0   'False
  312.          EndProperty
  313.          Height          =   330
  314.          Left            =   3270
  315.          ScaleHeight     =   330
  316.          ScaleWidth      =   330
  317.          TabIndex        =   7
  318.          Top             =   105
  319.          Width           =   330
  320.       End
  321.       Begin VB.PictureBox Picture2 
  322.          AutoRedraw      =   -1  'True
  323.          BorderStyle     =   0  'None
  324.          BeginProperty Font 
  325.             Name            =   "MS Sans Serif"
  326.             Size            =   8.25
  327.             Charset         =   0
  328.             Weight          =   400
  329.             Underline       =   0   'False
  330.             Italic          =   0   'False
  331.             Strikethrough   =   0   'False
  332.          EndProperty
  333.          Height          =   330
  334.          Left            =   2895
  335.          ScaleHeight     =   330
  336.          ScaleWidth      =   330
  337.          TabIndex        =   6
  338.          Top             =   105
  339.          Width           =   330
  340.       End
  341.       Begin VB.PictureBox Picture1 
  342.          AutoRedraw      =   -1  'True
  343.          BorderStyle     =   0  'None
  344.          BeginProperty Font 
  345.             Name            =   "MS Sans Serif"
  346.             Size            =   8.25
  347.             Charset         =   0
  348.             Weight          =   400
  349.             Underline       =   0   'False
  350.             Italic          =   0   'False
  351.             Strikethrough   =   0   'False
  352.          EndProperty
  353.          Height          =   330
  354.          Left            =   2520
  355.          ScaleHeight     =   322.667
  356.          ScaleMode       =   0  'User
  357.          ScaleWidth      =   336.286
  358.          TabIndex        =   5
  359.          Top             =   105
  360.          Width           =   330
  361.       End
  362.       Begin VB.Label TimeWindow 
  363.          Alignment       =   2  'Center
  364.          AutoSize        =   -1  'True
  365.          BackStyle       =   0  'Transparent
  366.          Caption         =   "[00] 00:00"
  367.          BeginProperty Font 
  368.             Name            =   "Digital SF"
  369.             Size            =   18
  370.             Charset         =   0
  371.             Weight          =   700
  372.             Underline       =   0   'False
  373.             Italic          =   0   'False
  374.             Strikethrough   =   0   'False
  375.          EndProperty
  376.          ForeColor       =   &H00FF8080&
  377.          Height          =   435
  378.          Left            =   420
  379.          TabIndex        =   19
  380.          Top             =   315
  381.          Width           =   1605
  382.       End
  383.       Begin VB.Label TotalPlay 
  384.          AutoSize        =   -1  'True
  385.          BackStyle       =   0  'Transparent
  386.          Caption         =   "Tracks: 00 CD Time: 00:00"
  387.          BeginProperty Font 
  388.             Name            =   "Arial"
  389.             Size            =   8.25
  390.             Charset         =   0
  391.             Weight          =   700
  392.             Underline       =   0   'False
  393.             Italic          =   0   'False
  394.             Strikethrough   =   0   'False
  395.          EndProperty
  396.          ForeColor       =   &H00FF8080&
  397.          Height          =   210
  398.          Left            =   180
  399.          TabIndex        =   18
  400.          Top             =   1350
  401.          Width           =   2070
  402.       End
  403.       Begin VB.Label TrackTime 
  404.          AutoSize        =   -1  'True
  405.          BackStyle       =   0  'Transparent
  406.          Caption         =   "Track Time: 00:00"
  407.          BeginProperty Font 
  408.             Name            =   "Arial"
  409.             Size            =   8.25
  410.             Charset         =   0
  411.             Weight          =   700
  412.             Underline       =   0   'False
  413.             Italic          =   0   'False
  414.             Strikethrough   =   0   'False
  415.          EndProperty
  416.          ForeColor       =   &H00FF8080&
  417.          Height          =   210
  418.          Left            =   2565
  419.          TabIndex        =   17
  420.          Top             =   1350
  421.          Width           =   1425
  422.       End
  423.       Begin VB.Label Label1 
  424.          Alignment       =   2  'Center
  425.          BackStyle       =   0  'Transparent
  426.          Caption         =   "Track No:"
  427.          BeginProperty Font 
  428.             Name            =   "Times New Roman"
  429.             Size            =   9.75
  430.             Charset         =   0
  431.             Weight          =   700
  432.             Underline       =   0   'False
  433.             Italic          =   0   'False
  434.             Strikethrough   =   0   'False
  435.          EndProperty
  436.          ForeColor       =   &H00FF8080&
  437.          Height          =   270
  438.          Left            =   2880
  439.          TabIndex        =   16
  440.          Top             =   915
  441.          Width           =   915
  442.       End
  443.    End
  444. Attribute VB_Name = "CDIface"
  445. Attribute VB_GlobalNameSpace = False
  446. Attribute VB_Creatable = False
  447. Attribute VB_PredeclaredId = True
  448. Attribute VB_Exposed = False
  449. Option Explicit
  450. Dim FFSpeed As Long    'Seconds to seek for ff/rew
  451. Dim CDPlaying As Boolean        'true if CD is currently playing
  452. Dim CDLoaded As Boolean         'true if CD is the the player
  453. Dim NumTracks As Integer        'number of Tracks on audio CD
  454. Dim TrackLength() As String     'array containing length of each Track
  455. Dim Track As Integer            'current Track
  456. Dim Min As Integer              'current Minute on Track
  457. Dim Sec As Integer              'current Second on Track
  458. Dim Cmd As String               'string to hold mci command strings
  459. Dim TotalTrackTime As String    'For Display.
  460. Dim TotalTrackPlay As String    'For Display.
  461. 'For Registry Settings.
  462. Public DenColor As Long, DenSkin As String
  463. 'For Moving Form.
  464. Dim MoveFrom As Boolean, LastPoint As POINTAPI
  465. 'Load the form..
  466. Private Sub Form_Load()
  467.     'Get Saved Form Position
  468.     LoadWindowPos Me
  469.     'Get Saved Colours & Skin
  470.     DenSettings False
  471.     'For Background             '
  472.     Me.Width = 4480
  473.     Me.Height = 2175
  474.     iTPPX& = Screen.TwipsPerPixelX
  475.     iTPPY& = Screen.TwipsPerPixelY
  476.     Call LoadIface
  477.     ' If we're already running, then quit
  478.     If (App.PrevInstance = True) Then
  479.         End
  480.     End If
  481.     ' Initialize variables
  482.     Timer1.Enabled = False
  483.     FFSpeed = 5
  484.     CDLoaded = False
  485.     ' If the cd is being used, then quit
  486.     If (Send("open cdaudio alias cd wait shareable", True) = False) Then
  487.         Send "Close all", False
  488.         End
  489.     End If
  490.     Send "set cd time format tmsf wait", True
  491.     Timer1.Enabled = True
  492. End Sub
  493. 'Setup the Background Graphics..
  494. Private Sub LoadIface()
  495.     Call BitBlt(picTitleBar.hDC, 0, 0, 300, 20, PicSourceImage.hDC, 0, 0, SRCCOPY)
  496.     picTitleBar.Refresh
  497.     Call BitBlt(picMain.hDC, 0, 0, 300, 125, PicSourceImage.hDC, 0, 20, SRCCOPY)
  498.     picMain.Refresh
  499.     Call BitBlt(picControlMin.hDC, 0, 0, 13, 13, PicSourceImage.hDC, 301, 139, SRCCOPY)
  500.     picControlMin.Refresh
  501.     Call BitBlt(picControlExit.hDC, 0, 0, 13, 13, PicSourceImage.hDC, 316, 139, SRCCOPY) '422, 145, SRCCOPY)
  502.     picControlExit.Refresh
  503.     Call BitBlt(picLoadSkin.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 324, 70, SRCCOPY)
  504.     picLoadSkin.Refresh
  505.     'The Buttons                '
  506.     Call BitBlt(Picture1.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 1, SRCCOPY)
  507.     Picture1.Refresh
  508.     Call BitBlt(Picture2.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 47, SRCCOPY)
  509.     Picture2.Refresh
  510.     Call BitBlt(Picture3.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 24, SRCCOPY)
  511.     Picture3.Refresh
  512.     Call BitBlt(Picture4.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 70, SRCCOPY)
  513.     Picture4.Refresh
  514.     Call BitBlt(Picture5.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 324, 1, SRCCOPY)
  515.     Picture5.Refresh
  516.     Call BitBlt(Picture6.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 93, SRCCOPY)
  517.     Picture6.Refresh
  518.     Call BitBlt(Picture7.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 116, SRCCOPY)
  519.     Picture7.Refresh
  520.     Call BitBlt(Picture8.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 324, 47, SRCCOPY)
  521.     Picture8.Refresh
  522.     Call BitBlt(Picture9.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 324, 24, SRCCOPY)
  523.     Picture9.Refresh
  524. End Sub
  525. 'Unload the Program..
  526. 'Private Sub Form_Unload(Cancel As Integer)
  527. '    'Close all MCI devices opened by this program
  528. '    Send "close all", False
  529. 'End Sub
  530. 'Send a MCI command string..
  531. Private Function Send(Cmd As String, fShowError As Boolean) As Boolean
  532.     Static rc As Long
  533.     Static errStr As String * 200
  534.     rc = mciSendString(Cmd, 0, 0, hwnd)
  535.     If (fShowError And rc <> 0) Then
  536.         mciGetErrorString rc, errStr, Len(errStr)
  537.         MsgBox errStr
  538.     End If
  539.     Send = (rc = 0)
  540. End Function
  541. 'Start the CD Playing..
  542. Private Sub picture1_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'play_Click()
  543.     Call BitBlt(Picture1.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 347, 1, SRCCOPY)
  544.     Picture1.Refresh
  545. End Sub
  546. Private Sub picture1_mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single) 'play_Click()
  547.     Call BitBlt(Picture1.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 1, SRCCOPY)
  548.     Picture1.Refresh
  549.     If X > 0 And X < Picture1.Width And Y > 0 And Y < Picture1.Height Then
  550.         If (CDLoaded) Then
  551.             Send "play cd", True
  552.             CDPlaying = True
  553.         End If
  554.     End If
  555. End Sub
  556. 'Stop the CD playing..
  557. Private Sub picture5_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  558.     Call BitBlt(Picture5.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 370, 1, SRCCOPY)
  559.     Picture5.Refresh
  560. End Sub
  561. Private Sub picture5_mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single)
  562.     Call BitBlt(Picture5.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 324, 1, SRCCOPY)
  563.     Picture5.Refresh
  564.     If X > 0 And X < Picture5.Width And Y > 0 And Y < Picture5.Height Then
  565.         If CDPlaying = True Then
  566.             Send "stop cd wait", True
  567.             Cmd = "seek cd to " & Track
  568.             Send Cmd, True
  569.             CDPlaying = False
  570.             Update
  571.             
  572.         End If
  573.     End If
  574. End Sub
  575. 'Pause the CD..
  576. Private Sub picture4_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  577.     Call BitBlt(Picture4.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 347, 70, SRCCOPY)
  578.     Picture4.Refresh
  579. End Sub
  580. Private Sub picture4_mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  581.     Call BitBlt(Picture4.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 70, SRCCOPY)
  582.     Picture4.Refresh
  583.     If X > 0 And X < Picture4.Width And Y > 0 And Y < Picture4.Height Then
  584.         If CDPlaying = True Then
  585.             Send "pause cd", True
  586.             CDPlaying = False
  587.             Update
  588.         End If
  589.     End If
  590. End Sub
  591. 'Goto Next Track..
  592. Private Sub picture3_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  593.     Call BitBlt(Picture3.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 347, 24, SRCCOPY)
  594.     Picture3.Refresh
  595. End Sub
  596. Private Sub picture3_mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  597.     Call BitBlt(Picture3.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 24, SRCCOPY)
  598.     Picture3.Refresh
  599.     If X > 0 And X < Picture3.Width And Y > 0 And Y < Picture3.Height Then
  600.         If (Track < NumTracks) Then
  601.             If (CDPlaying) Then
  602.                 Cmd = "play cd from " & Track + 1
  603.                 Send Cmd, True
  604.             Else
  605.                 If (CDLoaded) Then
  606.                     Cmd = "seek cd to " & Track + 1
  607.                     Send Cmd, True
  608.                 End If
  609.             End If
  610.         Else
  611.             If (CDLoaded) Then
  612.                 Send "seek cd to 1", True
  613.             End If
  614.         End If
  615.         Update
  616.     End If
  617. End Sub
  618. 'Goto previous Track..
  619. Private Sub picture2_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  620.     Call BitBlt(Picture2.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 347, 47, SRCCOPY)
  621.     Picture2.Refresh
  622. End Sub
  623. Private Sub picture2_mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  624.     Call BitBlt(Picture2.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 47, SRCCOPY)
  625.     Picture2.Refresh
  626.     If X > 0 And X < Picture2.Width And Y > 0 And Y < Picture2.Height Then
  627.         Dim from As String
  628.         If (Min = 0 And Sec = 0) Then
  629.             If (Track > 1) Then
  630.                 from = CStr(Track - 1)
  631.             Else
  632.                 from = CStr(NumTracks)
  633.             End If
  634.         Else
  635.             from = CStr(Track)
  636.         End If
  637.         If (CDPlaying) Then
  638.             Cmd = "play cd from " & from
  639.             Send Cmd, True
  640.         Else
  641.             If (CDLoaded) Then
  642.                 Cmd = "seek cd to " & from
  643.                 Send Cmd, True
  644.             End If
  645.         End If
  646.         Update
  647.     End If
  648. End Sub
  649. 'Fast forward..
  650. Private Sub picture7_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  651.     Call BitBlt(Picture7.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 347, 116, SRCCOPY)
  652.     Picture7.Refresh
  653. End Sub
  654. Private Sub picture7_mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  655.     Call BitBlt(Picture7.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 116, SRCCOPY)
  656.     Picture7.Refresh
  657.     If X > 0 And X < Picture7.Width And Y > 0 And Y < Picture7.Height Then
  658.         If (CDPlaying) Then
  659.             Dim s As String * 40
  660.             Send "set cd time format milliSeconds", True
  661.             mciSendString "status cd position wait", s, Len(s), 0
  662.             Cmd = "play cd from " & CStr(CLng(s) + FFSpeed * 1000)
  663.             mciSendString Cmd, 0, 0, 0
  664.             Send "set cd time format tmsf", True
  665.         Else
  666.             If (CDLoaded) Then
  667.                 If (CDPlaying) Then
  668.                     Cmd = "seek cd to " & CStr(CLng(s) + FFSpeed * 1000)
  669.                 End If
  670.             End If
  671.         End If
  672.         Update
  673.     End If
  674. End Sub
  675. 'Rewind the CD..
  676. Private Sub Picture6_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  677.     Call BitBlt(Picture6.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 347, 93, SRCCOPY)
  678.     Picture6.Refresh
  679. End Sub
  680. Private Sub Picture6_mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  681.     Call BitBlt(Picture6.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 301, 93, SRCCOPY)
  682.     Picture6.Refresh
  683.     If X > 0 And X < Picture6.Width And Y > 0 And Y < Picture6.Height Then
  684.         If (CDPlaying) Then
  685.             Dim s As String * 40
  686.             Send "set cd time format milliSeconds", True
  687.             mciSendString "status cd position wait", s, Len(s), 0
  688.             Cmd = "play cd from " & CStr(CLng(s) - FFSpeed * 1000)
  689.             mciSendString Cmd, 0, 0, 0
  690.             Send "set cd time format tmsf", True
  691.         Else
  692.             If (CDLoaded) Then
  693.                 If (CDPlaying) Then
  694.                     Cmd = "seek cd to " & CStr(CLng(s) - FFSpeed * 1000)
  695.                 End If
  696.             End If
  697.         End If
  698.         Update
  699.     End If
  700. End Sub
  701. 'Eject the CD..
  702. Private Sub picture9_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  703.     Call BitBlt(Picture9.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 370, 24, SRCCOPY)
  704.     Picture9.Refresh
  705. End Sub
  706. Private Sub picture9_mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  707.     Call BitBlt(Picture9.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 324, 24, SRCCOPY)
  708.     Picture9.Refresh
  709.     If X > 0 And X < Picture9.Width And Y > 0 And Y < Picture9.Height Then
  710.         Send "stop cd wait", True
  711.         Send "set cd door open", True
  712.         Update
  713.     End If
  714. End Sub
  715. 'Show About Form..
  716. Private Sub picture8_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  717.     Call BitBlt(Picture8.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 370, 47, SRCCOPY)
  718.     Picture8.Refresh
  719. End Sub
  720. Private Sub picture8_mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single) 'stopbtn_Click()
  721.     Call BitBlt(Picture8.hDC, 0, 0, 22, 22, PicSourceImage.hDC, 324, 47, SRCCOPY)
  722.     Picture8.Refresh
  723.     If X > 0 And X < Picture8.Width And Y > 0 And Y < Picture8.Height Then
  724.         CDAbout.Show
  725.     End If
  726. End Sub
  727. 'Exit/Close Button..
  728. Private Sub picControlExit_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  729.     Call BitBlt(picControlExit.hDC, 0, 0, 13, 13, PicSourceImage.hDC, 316, 153, SRCCOPY)
  730.     picControlExit.Refresh
  731. End Sub
  732. Private Sub picControlExit_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  733.     Call BitBlt(picControlExit.hDC, 0, 0, 13, 13, PicSourceImage.hDC, 316, 139, SRCCOPY)
  734.     picControlExit.Refresh
  735.     If X > 0 And X < picControlExit.Width And Y > 0 And Y < picControlExit.Height Then
  736.         If CDPlaying = True Then
  737.             Send "stop cd wait", True
  738.             Cmd = "seek cd to " & Track
  739.             Send Cmd, True
  740.             CDPlaying = False
  741.             Update
  742.             Send "Close all", True
  743.             SaveWindowPos Me
  744.             Unload Me
  745.         Else
  746.             Send "Close all", True
  747.             SaveWindowPos Me
  748.             Unload Me
  749.         End If
  750.     End If
  751. End Sub
  752. 'Minimise Button..
  753. Private Sub picControlMin_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  754.     Call BitBlt(picControlMin.hDC, 0, 0, 13, 13, PicSourceImage.hDC, 301, 153, SRCCOPY)
  755.     picControlMin.Refresh
  756. End Sub
  757. Private Sub picControlMin_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  758.     Call BitBlt(picControlMin.hDC, 0, 0, 13, 13, PicSourceImage.hDC, 301, 139, SRCCOPY)
  759.     picControlMin.Refresh
  760.     If X > 0 And X < picControlMin.Width And Y > 0 And Y < picControlMin.Height Then
  761.         Me.WindowState = 1
  762.     End If
  763. End Sub
  764. 'Moving The Form..
  765. Private Sub picTitleBar_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  766.     Dim POINT As POINTAPI
  767.     GetCursorPos POINT
  768.     LastPoint.X = POINT.X
  769.     LastPoint.Y = POINT.Y
  770.     MoveFrom = True
  771. End Sub
  772. Private Sub picTitleBar_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  773.     Dim iDX As Long, iDY As Long
  774.     Dim POINT As POINTAPI
  775.     If Not MoveFrom Then Exit Sub
  776.     GetCursorPos POINT
  777.     iDX& = (POINT.X - LastPoint.X) * iTPPX&
  778.     iDY& = (POINT.Y - LastPoint.Y) * iTPPY&
  779.     LastPoint.X = POINT.X
  780.     LastPoint.Y = POINT.Y
  781.     Me.Move Me.Left + iDX&, Me.Top + iDY&
  782. End Sub
  783. Private Sub picTitleBar_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  784.     MoveFrom = False
  785. End Sub
  786. 'Set the fast-forward speed..
  787. Private Sub FFSpeed_Click()
  788.     Dim s As String
  789.     s = InputBox("Enter the new speed in Seconds", "Fast Forward Speed", CStr(FFSpeed))
  790.     If IsNumeric(s) Then
  791.         FFSpeed = CLng(s)
  792.     End If
  793. End Sub
  794. 'Timer Update..
  795. Private Sub Timer1_Timer()
  796.     Update
  797. End Sub
  798. 'Update the display and state variables..
  799. Private Sub Update()
  800.     Static s As String * 30
  801.     ' Check if CD is in the player
  802.     mciSendString "status cd media present", s, Len(s), 0
  803.     If (CBool(s)) Then
  804.         ' Enable all the controls, get CD information
  805.         If (CDLoaded = False) Then
  806.             mciSendString "status cd number of Tracks wait", s, Len(s), 0
  807.             NumTracks = CInt(Mid$(s, 1, 2))
  808.         
  809.             ' If CD only has 1 Track, then it's probably a data CD
  810.             If (NumTracks = 1) Then
  811.                 Exit Sub
  812.             End If
  813.         
  814.             mciSendString "status cd length wait", s, Len(s), 0
  815.             TotalTrackPlay = "Tracks: " & NumTracks & "  CD Time: " & Left(s, 5)
  816.             TotalPlay.Caption = TotalTrackPlay
  817.             
  818.             ReDim TrackLength(1 To NumTracks)
  819.             Dim i As Integer
  820.             For i = 1 To NumTracks
  821.                 Cmd = "status cd length Track " & i
  822.                 mciSendString Cmd, s, Len(s), 0
  823.                 TrackLength(i) = s
  824.             Next
  825.             
  826.             '####################################
  827.             ' Fill list of Track Nos.
  828.             Dim it As Integer
  829.             cboTrack.Clear
  830.             For it = 1 To NumTracks
  831.                 cboTrack.AddItem it
  832.             Next it
  833.             cboTrack.Text = cboTrack.List(0)
  834.             '####################################
  835.             Send "seek cd to 1", True
  836.             CDLoaded = True
  837.         End If
  838.         ' Update the Track time display
  839.         mciSendString "status cd position", s, Len(s), 0
  840.         Track = CInt(Mid$(s, 1, 2))
  841.         Min = CInt(Mid$(s, 4, 2))
  842.         Sec = CInt(Mid$(s, 7, 2))
  843.         TimeWindow.Caption = "[" & Format(Track, "00") & "] " & Format(Min, "00") _
  844.             & ":" & Format(Sec, "00")
  845.         TotalTrackTime = "Track Time: " & Left(TrackLength(Track), 5)
  846.         TrackTime.Caption = TotalTrackTime
  847.         cboTrack.Text = cboTrack.List(Track - 1)
  848.         
  849.         ' Check if CD is playing
  850.         mciSendString "status cd mode", s, Len(s), 0
  851.         CDPlaying = (Mid$(s, 1, 7) = "playing")
  852.     Else
  853.         'eject.Enabled = False
  854.         ' Disable all the controls, clear the display
  855.         If (CDLoaded = True) Then
  856.             CDLoaded = False
  857.             CDPlaying = False
  858.             TotalPlay.Caption = ""
  859.             TrackTime.Caption = ""
  860.             TimeWindow.Caption = ""
  861.         End If
  862.     End If
  863. End Sub
  864. Private Sub cboTrack_click()
  865.     If (CDLoaded) Then
  866.         'Set cboTrack value first
  867.         cboTrack.ListIndex = Val(cboTrack.Text) - 1
  868.         If (Track <= NumTracks) Then
  869.             If (CDPlaying) Then
  870.                 Cmd = "play cd from " & Val(cboTrack.Text)
  871.                 Send Cmd, True
  872.             Else
  873.                 Cmd = "seek cd to " & Val(cboTrack.Text)
  874.                 Send Cmd, True
  875.                 Send "play cd", True
  876.                 CDPlaying = True
  877.             End If
  878.         End If
  879.     Else
  880.         Send "seek cd to 1", True
  881.     End If
  882.     Update
  883. End Sub
  884. Private Sub picLoadSkin_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  885.     Call BitBlt(picLoadSkin.hDC, 0, 0, 70, 23, PicSourceImage.hDC, 370, 70, SRCCOPY)
  886.     picLoadSkin.Refresh
  887. End Sub
  888. Private Sub picLoadSkin_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  889.     Dim Ret As Long
  890.     If GetCapture() <> picLoadSkin.hwnd Then
  891.         Ret = SetCapture(picLoadSkin.hwnd)
  892.         Call BitBlt(picLoadSkin.hDC, 0, 0, 70, 23, PicSourceImage.hDC, 324, 70, SRCCOPY)
  893.         picLoadSkin.Refresh
  894.         Me.MousePointer = 99
  895.     End If
  896.     If X > 0 And X < picLoadSkin.Width And Y > 0 And Y < picLoadSkin.Height Then
  897.         CurrentX = X
  898.         CurrentY = Y
  899.     Else
  900.         If GetCapture() = picLoadSkin.hwnd Then
  901.             Ret = ReleaseCapture()
  902.             Call BitBlt(picLoadSkin.hDC, 0, 0, 70, 23, PicSourceImage.hDC, 324, 70, SRCCOPY)
  903.             picLoadSkin.Refresh
  904.             Me.MousePointer = 0
  905.         End If
  906.     End If
  907. End Sub
  908. Private Sub picLoadSkin_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  909.     On Error GoTo Error_Event:
  910.     Call BitBlt(picLoadSkin.hDC, 0, 0, 70, 23, PicSourceImage.hDC, 324, 70, SRCCOPY)
  911.     picLoadSkin.Refresh
  912.     If X > 0 And X < picLoadSkin.Width And Y > 0 And Y < picLoadSkin.Height Then
  913.         cdgIface.InitDir = App.Path
  914.         cdgIface.Filter = "Skin Files (*.bmp)|*.bmp"
  915.         cdgIface.CancelError = True
  916.         cdgIface.ShowOpen
  917.         If cdgIface.filename <> "" Then
  918.             DenSkin = cdgIface.filename
  919.         End If
  920.         PicSourceImage.Picture = LoadPicture(DenSkin)
  921.         Call LoadIface
  922.         DenSettings True
  923.     End If
  924. Error_Event:
  925.     Exit Sub
  926. End Sub
  927. Private Sub TimeWindow_Click()
  928.     With cdgIface
  929.         .CancelError = True
  930.         On Error GoTo ColorErrHandler
  931.         .ShowColor
  932.         TimeWindow.ForeColor = .Color
  933.         TotalPlay.ForeColor = .Color
  934.         TrackTime.ForeColor = .Color
  935.         cboTrack.ForeColor = .Color
  936.         Label1.ForeColor = .Color
  937.         DenColor = .Color
  938.     End With
  939.     DenSettings (True)
  940. ColorErrHandler:
  941. End Sub
  942. Public Sub DenSettings(DenSet As Boolean)
  943.     '>> DenSkin = "Path & Filename" from Load Dialog
  944.     If (DenSet) Then
  945.         'Save Program Color Setting. (This Works).
  946.         SaveColSet Me, DenColor
  947.         If DenSkin <> "" Then
  948.             'Save Program Skin Setting. (This Works).
  949.             SaveSkinSet Me, DenSkin
  950.         End If
  951.     Else
  952.         'Load Program Color Setting. (This Works).
  953.         LoadColSet Me
  954.         'Load Program Skin Setting. (This Works).
  955.         LoadSkinSet Me
  956.     End If
  957. End Sub
  958.